
# 私有变量案例

class Person():
    name = "caixiaojun"
    __age = 18

# 基类写在括号里
class Teacher(Person):
    pass

t = Teacher()
print(t.name)
print(Teacher.name)

# __mro__

class A():
    pass

class B(A):
    pass

class C(A):
    pass

class D(C, B):
    pass

print(D.__mro__)

class Person():

    def fget(self):
        return self._name

    def fset(self, name):
        self._name = name.upper()

    def fdel(self):
        self._name = "NoName"

    name = property(fget, fset, fdel, "dasdeiufhief")


p1 = Person()
p1.name = "caixiaojun"
print(p1.name)